package com.xuyanze.es.face;

import java.io.Serializable;

/**
 * @author ：lzy
 * @date ：2023-01-12
 * @description：
 */
public interface Compare<Children,R> extends Serializable {

    /**
     * 等于
     * @param field
     * @param val
     * @return
     */
    Children eq(R field, Object val);
    Children eq(String field, Object val);

    /**
     * 多值包含
     * @param field
     * @param vals
     * @return
     */
    Children eqTerms(R field, Object[] vals);
    Children eqTerms(String field, Object[] vals);
    Children eqWithFilter(R field, Object val);
    Children eqWithFilter(String field, Object val);


    /**
     * 等于 field.keyword
     * @param field
     * @param val
     * @return
     */
    Children eqKeyWord(R field, Object val);


    /**
     * 大于 (>)
     * @param field
     * @param val
     * @return
     */
    Children gt(R field, Object val);
    Children gtWithFilter(R field, Object val);

    /**
     * 大于等于 (>=)
     * @param field
     * @param val
     * @return
     */
    Children ge(R field, Object val);
    Children geWithFilter(R field, Object val);

    /**
     * 小于 (<)
     * @param field
     * @param val
     * @return
     */
    Children lt(R field, Object val);
    Children ltWithFilter(R field, Object val);

    /**
     * 小于等于 (<=)
     * @param field
     * @param val
     * @return
     */
    Children le(R field, Object val);
    Children leWithFilter(R field, Object val);

    /**
     * !=
     * @param field
     * @param val
     * @return
     */
    Children ne(R field, Object val);

    /**
     * 模糊查询 like '%field%'
     * @param field
     * @param val
     * @return
     */
    Children like(R field, Object val);
    Children likeKeyWord(R field, Object val);


    /**
     * 模糊查询 not like '%field%'
     * @param field
     * @param val
     * @return
     */
    Children notLike(R field, Object val);
    Children notLikeKeyWord(R field, Object val);

    /**
     * 模糊查询 like '%field'
     * @param field
     * @param val
     * @return
     */
    Children leftLike(R field, Object val);
    Children leftLikeKeyWord(R field, Object val);


    /**
     * 模糊查询 like 'field%'
     * @param field
     * @param val
     * @return
     */
    Children rightLike(R field, Object val);
    Children rightLikeKeyWord(R field, Object val);

    /**
     * between
     * @param field
     * @param from
     * @param to
     * @return
     */
    Children between(R field, Object from, Object to);

    /**
     * notBetween
     * @param field
     * @param from
     * @param to
     * @return
     */
    Children notBetween(R field, Object from, Object to);


}
